home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Book Chapters / 10 - Networking / NovelNetwar / globals.c < prev    next >
Text File  |  1995-05-12  |  913b  |  71 lines

  1. //    Global variables!
  2.  
  3. #include "NovelNetwar.h"
  4. #include <GestaltEqu.h>
  5. #include <Traps.h>
  6. #include <Palettes.h>
  7.  
  8. char            alive,IAmFrontApp,hasColourQD,hasAppleTalk;
  9. Rect            nullRect;
  10. char            errorMessage[256];
  11. int                connectionMethod;
  12.  
  13.  
  14.  
  15.  
  16.  
  17. void globalsInit(void)
  18. {
  19. SysEnvRec        theWorld;
  20. long            gestaltResponse;
  21.  
  22.  
  23.     alive = TRUE;
  24.     
  25.     IAmFrontApp = TRUE;
  26.     
  27.     hasColourQD = FALSE;
  28.     hasAppleTalk = FALSE;
  29.     
  30.     SetRect(&nullRect,-32768,-32768,32767,32767);
  31.     
  32.     connectionMethod = NONE;
  33.  
  34.     
  35.     if (SysEnvirons(1,&theWorld) == noErr)
  36.     {
  37.         if (theWorld.hasColorQD)
  38.         {
  39.             if (HasDepth(GetMainDevice(),8,gdDevType,gdDevType) != 0)
  40.             {
  41.                 hasColourQD = TRUE;
  42.             }
  43.         }
  44.     }
  45.     
  46.     
  47.     if (TrapAvailable((int) _Gestalt) == noErr)
  48.     {
  49.         if (Gestalt(gestaltAppleTalkVersion,&gestaltResponse) == noErr)
  50.         {
  51.             if (gestaltResponse != 0)
  52.             {
  53.                 hasAppleTalk = TRUE;
  54.             }
  55.         }
  56.     }
  57. }
  58.  
  59.  
  60.  
  61. void globalsStartup(void)
  62. {
  63.  
  64. }
  65.  
  66.  
  67.  
  68. void globalsShutDown(void)
  69. {
  70.  
  71. }